﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		INHibernateHelper.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 //   File:            INHibernateHelper.cs
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using NHibernate;

namespace Dexter.Repository.NHibernate.Helpers
{
	/// <summary>
	/// The contract of NHibernate configuration.
	/// </summary>
	public interface INHibernateHelper {
		/// <summary>
		/// Gets or sets the session factory.
		/// </summary>
		/// <value>The session factory.</value>
		ISessionFactory SessionFactory { get; set; }

		/// <summary>
		/// Return the NHibernate configuration.
		/// </summary>
		/// <value>The configuration.</value>
		global::NHibernate.Cfg.Configuration Configuration { get; }

		/// <summary>
		/// Configures NHibernate
		/// </summary>
		void Configure (  );

		/// <summary>
		/// Gets the session.
		/// </summary>
		/// <returns></returns>
		ISession GetSession ( );
		
		/// <summary>
		/// Checks if the database schema should be updated.
		/// </summary>
		/// <returns><c>True</c> if the schema requires the update;  otherwise, <c>false</c>.</returns>
		bool ShouldUpdateSchema ( );

		/// <summary>
		/// Updates the database schema.
		/// </summary>
		void UpdateSchema ( );

		/// <summary>
		/// Initializes the schema.
		/// </summary>
		void InitializeSchema ( );

		/// <summary>
		/// Drops the schema.
		/// </summary>
		void DropSchema ( );

		/// <summary>
		/// Gets the get connection string.
		/// </summary>
		/// <value>The get connection string.</value>
		string GetConnectionString { get; }
	}
}
